package com.example.demo.algorithm.sort.choice;

public class Student implements Comparable<Student> {
    private String name;
    private Integer core;

    public Student(String name, Integer core) {
        this.name = name;
        this.core = core;
    }

    @Override
    public boolean equals(Object o) {
        if (o == null) {
            return false;
        }
        if (this == o) {
            return true;
        }
        if (o.getClass() != this.getClass()) {
            return false;
        }
        Student student = (Student) o;
        return this.getClass().equals(student.getClass());
    }

    @Override
    public String toString() {
        return String.format("姓名: %s",name);
    }

    @Override
    public int compareTo(Student o) {
        return this.core - o.core;
    }
}
